home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / presto / prest1_0.lha / src / stack.C < prev    next >
C/C++ Source or Header  |  1991-12-11  |  929b  |  52 lines

  1. //
  2. // Stack maintenance
  3. //
  4. // Modification History:
  5. //
  6. //   05-Dec-89  John Faust
  7. //   Remove all stack free lists.  Allocate stacks of fixed size when thread
  8. //   is allocated.  Stack remains associated with owning thread.  More
  9. //   efficient (removes search of stack freelist for stack of proper size,
  10. //   allocation of stack if one of proper size not found, and eliminates
  11. //   need to balance stack freelists).
  12. //
  13. //   16-Nov-1989  John Faust
  14. //   Add support for per-processor stack freelists.
  15. //
  16.  
  17. #include "presto.h"
  18.  
  19. Stack::Stack(int sz)
  20. {
  21.  
  22.         //
  23.         //  Init stack - overloaded new
  24.     //     will have allocated space for us
  25.         //
  26. //      stackcnt++;
  27.  
  28.     if (sz)    {
  29.         sz = sz &(~0x200);        // force page size boundaries
  30.     } 
  31.  
  32.     st_base = (int*)new char[sz];
  33.     st_size = sz;
  34.     st_limit = sz;
  35. }
  36.  
  37.  
  38. //static shared_t stackcnt = 0;
  39. int
  40. Stack::numstacksbuilt()
  41. //    return stackcnt;
  42.         return -1;
  43. }        
  44.     
  45.  
  46.  
  47.     
  48.  
  49.             
  50.             
  51.